package com.aftersale.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 
 * @TableName logs
 */
@TableName(value ="log")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Log implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 操作名称
     */
    @Size(max = 20,min = 1,message = "请输入正确的操作名称")
    private String operation;

    /**
     * 操作类型
     */
    @Size(max = 20,min = 1,message = "请输入正确的操作类型")
    private String type;

    /**
     * 
     */
    private Integer userId;

    /**
     * 
     */
    @Size(max = 20,min = 1,message = "请输入正确的用户名")
    private String userName;

    /**
     * 
     */
    @Pattern(message = "请按以下格式输入时间：yyyy-MM-dd HH:mm:ss(年-月-日 时:分:秒)",
            regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$")
    private String time;

    private String details;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}